package gov.pbc.nn.kjgl.AbroadApproval.handle;

import gov.pbc.nn.core.utils.SecurityUtils;
import gov.pbc.nn.kjgl.Constants;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.springframework.stereotype.Component;

import com.bstek.bdf2.core.business.IUser;
import com.bstek.uflo.env.Context;
import com.bstek.uflo.model.ProcessInstance;
import com.bstek.uflo.process.handler.AssignmentHandler;
import com.bstek.uflo.process.node.TaskNode;

@Component("bWAssignmentHandler")
public class BWAssignmentHandler implements AssignmentHandler {


	@Override
	public Collection<String> handle(TaskNode taskNode, ProcessInstance processInstance,
			Context context) {
		// TODO Auto-generated method stub
		List<String> users = new ArrayList<String>();
		String deptId = "489145101058";
		//String role = "综合员";
		String role = Constants.ROLE_ZHY;
		List<IUser> IUsers = SecurityUtils.getUserByRoleForDeptWithChildren(deptId, role);
		for(IUser u:IUsers){
			users.add(u.getUsername());
		}
		return users;

	}

}
